package com.iweb.auth.model;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import org.springframework.security.core.GrantedAuthority;

import java.io.Serializable;

/**
 * <p>
 *
 * </p>
 *
 * @author 超人
 * @since 2020-09-10
 */
@TableName("tb_power")
public class Power extends Model<Power> implements GrantedAuthority {

    private static final long serialVersionUID = 1L;

    @TableId("id")
    private String id;

    @TableField("power")
    private String power;

    @TableField("description")
    private String description;

    @TableField("url")
    private String url;


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getPower() {
        return power;
    }

    public void setPower(String power) {
        this.power = power;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "Power{" +
                "id=" + id +
                ", power=" + power +
                ", description=" + description +
                ", url=" + url +
                "}";
    }

    @Override
    public String getAuthority() {
        return power;
    }
}
